<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ include file="/common/taglibs.jsp" %>
<head>
    <title>栏目</title>
    <title>Title</title>
    <link rel="stylesheet" href="/assets/admin/css/pintuer.css">
    <link rel="stylesheet" href="/assets/admin/css/admin.css">
    <script type="text/javascript" src="/assets/js/myjs/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="/assets/admin/js/pintuer.js"></script>
    <link href="/assets/layui/css/layui.css" rel="stylesheet">
</head>
<body>
</form>
<div class="panel admin-panel">
    <form class="layui-form" action="user/findBySql" id="listform" method="post">
        <div class="padding border-bottom">
            <ul class="serch" style="padding-left: 10px">
                <li>
                    <input type="text" placeholder="请输入用户名" name="userName" class="input" value="${obj.userName}"
                           style="width: 250px;line-height: 17px;display: none"/>
                    <input type="text" placeholder="手机号" name="userPhone" class="input" value="${obj.userName}"
                           style="width: 250px;line-height: 17px;display: inline-block"/>
                    <input type="text" placeholder="用户账号" name="userCode" class="input" value="${obj.userName}"
                           style="width: 250px;line-height: 17px;display: inline-block"/>

                    <div class="layui-input-inline">
                        <select name="userType" lay-verify="required">
                            <option value="">类别</option>
                            <option value="0">仓库</option>
                            <option value="1">管理员</option>
                            <option value="2">金牌员工</option>
                            <option value="3">买家</option>
                        </select>
                    </div>
                    <input class="" type="submit" value="搜索">
                </li>
            </ul>
        </div>
    </form>
    <table class="table table-hover text-center">
        <tr>
            <th>用户主键</th>
            <th>用户类型</th>
            <th>用户名称</th>
            <th>用户账号</th>
            <th>用户密码</th>
            <th>用户手机</th>
            <th>是否锁定</th>
            <th>最后登录时间</th>
            <th>最后登录ip</th>
        </tr>
        <c:forEach items="${pagers.datas}" var="data" varStatus="1">
        <td>${data.rowId}</td>
        <td>${data.userType == 0 ? "仓库" : data.userType == 1 ? "管理员" : data.userType == 2 ? "金牌员工":" 买家"  }</td>
        <td>${data.userName}</td>
        <td>${data.userCode}</td>
        <td>我不告诉你</td>
        <td>${data.userPhone}</td>
        <td>${data.isLock}</td>
        <td><fmt:formatDate value="${data.lastLoginDate}" pattern="yyyy-MM-dd hh:mm:ss"></fmt:formatDate></td>
        <td>${data.lastLoginIp}</td>
        <td>
            <div class="btn-group">
                <a class="button border-main" href="${ctx}/user/sonFindBySql?fatherId=${data.rowId}"><span
                        class="icon-search">详细信息</span></a>
                <a class="button border-main" href="${ctx}/user/edit?rowId=${data.rowId}"><span
                        class="icon-edit">修改</span></a>
                <a class="button border-red" href="${ctx}/user/delete?rowId=${data.rowId}"><span
                        class="icon-trash-o">删除</span></a>
            </div>
        </td>
        <tr>
            </c:forEach>
            <td colspan="8">
                <div class="pagelist">
                    <!--分页开始-->
                    <pg:pager url="${ctx}/user/findBySql" maxIndexPages="5" items="${pagers.total}"
                              maxPageItems="15"
                              export="curPage=pageNumber">
                        <pg:last>
                            共${pagers.total}记录，共${pageNumber}页，
                        </pg:last>
                        当前第${curPage}页
                        <pg:first>
                            <a href="${pageUrl}">首页</a>
                        </pg:first>
                        <pg:prev>
                            <a href="${pageUrl}">上一页</a>
                        </pg:prev>
                        <pg:pages>
                            <c:choose>
                                <c:when test="${curPage eq pageNumber}">
                                    <font color="red">[${pageNumber}]</font>
                                </c:when>
                                <c:otherwise>
                                    <a href="${pageUrl}">${pageNumber}</a>
                                </c:otherwise>
                            </c:choose>
                        </pg:pages>
                        <pg:next>
                            <a href="${pageUrl}">下一页</a>
                        </pg:next>
                        <pg:last>
                            <c:choose>
                                <c:when test="${curPage eq pageNumber}">
                                    <font color="red">尾页</font>
                                </c:when>
                                <c:otherwise>
                                    <a href="${pageUrl}">尾页</a>
                                </c:otherwise>
                            </c:choose>
                        </pg:last>
                    </pg:pager>
                </div>
            </td>
        </tr>
    </table>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.5.7/layui.js"></script>
<script>
    function changeSearch() {

        $('#listform').submit();
    }
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer
            , form = layui.form;
    });
</script>
</body>
</html>

